/*************************************************************************
> File Name: publisher.cpp
> Author: chenzengba
> Mail: chenzengba@gmail.com
> Created Time: Sat 23 Apr 2016 12:13:24 PM CST
************************************************************************/

#include "redis_publisher.h"

int main(int argc, char *argv[])
{
	CRedisPublisher publisher;

	bool ret = publisher.init();
	if (!ret)
	{
		printf("Init failed.\n");
		return 0;
	}

	ret = publisher.connect();
	if (!ret)
	{
		printf("connect failed.");
		return 0;
	}

	while (true)
	{
		publisher.publish("test-channel", "Test message");
		sleep(1);
	}

	publisher.disconnect();
	publisher.uninit();
	return 0;
}
